package deepbrain.simnetwork.mechanism;

import java.util.List;

import deepbrain.simnetwork.network.Network;
import deepbrain.simnetwork.network.NetworkState;
import deepbrain.simnetwork.network.NodeState;

/**
 * A Mechanism class represents a rule. Network states change in that rule.
 * 
 * @see GenericMechanism
 * 
 * @author Li Yang
 * @create 2009-2-22
 */
public interface Mechanism {

	/**
	 * Process the Network by this mechanism's own rule and return the next
	 * network's state, which consist of each node's next state.
	 * 
	 * For the reason that NodeState is a probability of firing rather
	 * deterministic, the NetworkState which contains every node's NodeState is
	 * a joint probability distribution of each joint state.
	 * 
	 * 
	 * @param network
	 *            the Network to be processed under that mechanism
	 * 
	 * @return the next network state
	 */
	public NetworkState process(Network network, NetworkState state,
			List<Integer> subset);

	/**
	 * Return the specified node's next state in the probability of firing
	 */
	public NodeState nextNodeState(int node, Network network, NetworkState state);

	
	public void initialize(MechanismProperties properties);
	
}
